#include<stdio.h>
#include<sys/stat.h>
#include<fcntl.h>
#include<sys/types.h>
#include<unistd.h>

int main()
{
  close(1);
  int fd = open("./log.txt",O_CREAT | O_WRONLY,0664);
  write(fd,"write\n",6);
  fprintf(stdout,"hello\n");
  fprintf(stdout,"hello\n");
  fprintf(stdout,"hello\n");
  fprintf(stdout,"hello\n");

  fork();
  return 0;
}
